inforettest is package{
  import infoset;

  var I1 := iColl( hash of { "eventVersion"-> iText("1.0");
     "sourceString"->iText("::1 - - [29/Aug/2010:06:12:57 +0700] \"OPTIONS * HTTP/1.0\" 200 152 \"-\" \"Apache/2.2.12 (Ubuntu) (internal dummy connection)\"");
     "sourceName"->iText("access log");
     "Status"->iText("200");
     "Useragent"->iText("Apache/2.2.12 (Ubuntu) (internal dummy connection)");
     "Date"->iText("29/Aug/2010:06:12:57 +0700");
     "Host"->iText("::1");
     "Ident"->iText("-");
     "Referer"->iText("-");
     "Request"->iText("OPTIONS * HTTP/1.0");
     "Bytes"->iText("152");
     "Authuser"->iText("-");
     "messageDate"->iNum(1368743816990L);
     "processedDate"->iNum(1368743816990L);
     "hostBytes"->iNum(3040L);
     "numUniqueUsers"->iNum(19L);
     "bigDownloadUser"->iText("false");
     "avgHostBytes"->iFlt(61668.47916666669);
     "imageBytes"->iNum(110408L);
     "pictureBytes"->iNum(396883L);
     "statusFrequency"->iSeq(array of {
	iColl(hash of {"200"->iNum(75L)});
	iColl(hash of {"304"->iNum(60L)});
	iColl(hash of {"404"->iNum(5L)});
	iColl(hash of {"206"->iNum(2L)});
	iColl(hash of {"301"->iNum(2L)})});
     "totalBytes"->iNum(2425928L);
     "referFrequency"->iSeq(array of {
	iColl(hash of {"-"->iNum(85L)});
	iColl(hash of {"http://www.vallop.in.th/"->iNum(36L)});
	iColl(hash of {"http://www.tb1nkp.com/webboard/view.php?No=1"->iNum(6L)});
	iColl(hash of {"http://www.kpsw.ac.th/teacher/piyaporn/page3.htm"->iNum(5L)});
	iColl(hash of {"http://whois.domaintools.com/ntsdc.go.th"->iNum(4L)})})});

  main() do {
    logMsg(info,"Init $I1");

    logMsg(info,"Look=$(I1[list of {kString("statusFrequency");kInt(0);kString("200")}])");

    assert I1[list of {kString("statusFrequency");kInt(0);kString("200")}]=iNum(75L);

    I1[list of {kString("statusFrequency");kInt(0);kString("404")}] := iNum(7L);
    logMsg(info,"After update $I1");
 
    assert I1[list of {kString("statusFrequency");kInt(0);kString("200")}]=iNum(75L);
    assert I1[list of {kString("statusFrequency");kInt(0);kString("404")}]=iNum(7L);

    remove I1[list of {kString("statusFrequency");kInt(0)}]
    logMsg(info,"After remove $I1");

    assert not present I1[list of {kString("statusFrequency");kInt(0);kString("404")}];

    for E in I1 do
	logMsg(info,display(E));

    for P->E in I1 do 
	logMsg(info,"Path=$P, E=$E");

    assert jParse("true" as (list of char))=(iTrue,list of {});
    assert jParse("34" as (list of char)) = (iNum(34l),list of {});
    
    logMsg(info,"float parse = $(jParse("-45.45e23" as (list of char)))");
    assert jParse("-45.45e23" as (list of char)) matches (F,list of {}) and approx(F,iFlt(-45.45e23));
  }

  approx has type (infoset,infoset)=>boolean;
  approx(iFlt(X),iFlt(Y)) is abs(X-Y)/abs(X+Y)<1.0e-10;
}